<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body></body>
</html>
<script>
    const regx = /\d+/g;
    const str = "123|456|789";
    const result = str.matchAll(regx);
    for (const item of result) {
        console.log(item);
    }
</script>
